﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BattleCity
{
    public class Cuponera
    {
        public List<Bonus> cupones { get; private set; }


        private Cuponera()
        {
            cupones = new List<Bonus>();
        }
        private static Cuponera cuponera = null;
        public static Cuponera getCuponera()
        {
            if (cuponera == null)
            {
                cuponera = new Cuponera();
            }
            return cuponera;
        }
        public static void Reset()
        {
            cuponera = null;
        }
        
        
        
        public void Add(Bonus bonus)
        {
            cupones.Add(bonus);
        }
        public Bonus Get()
        {
            if (cupones.Count > 0)
            {
                Bonus ultimo = cupones.Last();
                cupones.Remove(ultimo);
                return ultimo;
            }
            return null;
        }
    }
}
